“Return type” 指函数/方法执行后返回的数据类型,例如 int、string、boolean,或表示不返回值的 void。在静态类型语言中,它常用于类型检查与接口约定;在部分动态语言中也可通过注解/文档说明返回类型。(在某些语境下也可指“返回值的类型”,含义相近。)
/rɪˈtɝːn taɪp/
The return type of this function is int.
这个函数的返回类型是 int。
If the method’s return type is a list of strings, callers must handle multiple results rather than a single value.
如果这个方法的返回类型是字符串列表,调用者就必须处理多个结果,而不是单个值。
“Return” 来自拉丁语 *re-*(“回、再”)+ tornare(“转动、回转”),引申为“返回”;“Type” 来自希腊语 typos(“印记、模子、类型”)。组合成 “return type”,在计算机科学中固定指“返回值的类型”。
int、void)。